package com.steward.controller.user;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.steward.commons.Result;
import com.steward.dto.card.CardConsumeDTO;
import com.steward.dto.card.UserCardDTO;
import com.steward.server.card.CardService;
import com.steward.server.user.UserService;

/**
 * 用户接口
 * 
 * @author mastercheng
 * @since 2017-03-07 20:43:53
 */
@RestController
public class UserController {

	private static Logger logger = Logger.getLogger(UserController.class);

	@Resource
	private UserService userService;

	/**
	 * 登陆注册接口
	 * 
	 * @param account，
	 * @return
	 */
	@GetMapping("/users/ver1/login/{account}/{verifiCode}")
	public @ResponseBody String loginToRegisterController(@PathVariable("account") String account,@PathVariable("verifiCode") String verifiCode,HttpSession httpSession) {
		logger.info("LoginToRegisterController>>account:" + account+" verifiCode"+verifiCode);
		
		
//		Result<List<UserCardDTO>> result = cardService.queryUserCardList(userId);
//		return JSONObject.toJSONString(result, SerializerFeature.WriteMapNullValue);
		return userService.loginToRegister(account, verifiCode,httpSession).toString();
	}





}
